
\section{Model Predictive Control}

\label{sec:mpc}

The Model Predictive Controller we use in this project is a quadratic program
subject to Linear-Time-Invariant dynamics and boxed constraints.  More details
about MPC for building HVAC systems can be found in \cite{CSM}. The following
constrained finite time optimization problem is posed at time step $k$:

\begin{subequations}
\label{eq:MPCcontroller}
\begin{align}
& \min_{u_i(k),x(k)} \sum_{k=0}^{N-1} \sum_{i=1}^{n} u_i(k)R_i(k)u_i(k) \\
& s.t. \hspace{0.2cm} x_i(k+1) = A_ix_i(k) + B_iu_i(k) + d_i(k) \\
& \hspace{0.65cm} x_i(k+1) \in \left[ \underline{x}, \bar{x} \right] \\
& \hspace{0.65cm} u_i(k) \in \left[ \underline{u_i}, \bar{u_i} \right] \\
& \hspace{0.65cm} x_i(0) = x_i(t) \\
& \hspace{0.65cm} \forall k \in \left\{ 0, \ldots, N-1 \right\} \\
& \hspace{0.65cm} \forall i \in \left\{1, \ldots, N \right\}
\end{align}
\end{subequations}


Let the optimal solution to problem \eqref{eq:MPCcontroller} be
\small
\begin{equation}
\mathbf{U}^* = \{u_1^*(0),\ldots,u_n^*(0),u_1^*(1),\ldots,u_n^*(1),\ldots,u_1^*(N-1),\ldots,u_n^*(N-1)\}. \label{eqn:ustar}
\end{equation} \normalsize
At time step $k$, the solution $u_i^*(0) ~\forall i \in \{ 1,\ldots,n \}$ is
implemented. The optimization \eqref{eq:MPCcontroller} is repeated at time
$k+1$, with the updated state estimation $x_i(k+1)$ and estimated load
$\hat{d_i}(k+1)$, yielding a receding horizon control strategy.

For our application, typically $n$ and $N$ are large. The state $x$ is temperature and
the controls $u$ are cooling/heating power inputs and/or other inputs such as
pressure / mass flow rate / etc. A typical temperature profile and controller
profile are provided in Figure \ref{fig:buildingMPC} for $n=1$ and $N=180$. The
black dashed lines correspond to ``open loop" profiles that are calculated by
the optimization problem \ref{eq:MPCcontroller} at a time step $k$. The green line
corresponds to the actual temperature and control used. Note that the green line
matches the black line fairly well because perfect knowledge of the disturbance
and perfect dynamics modeling are assumed.

\begin{figure}[h!]
%\center
\includegraphics[width=\columnwidth]{figures/FinalTempControlProfile-eps-converted-to.pdf}
  \label{fig:buildingMPC}
\end{figure}

